/*
 * SpeechFile.h
 *
 *  Created on: 29 Mar 2011
 *      Author: sinan
 */
#ifndef SPEECHFILE_H_
#define SPEECHFILE_H_

#include <iostream>
#include <fstream>
#include <string.h>
#include <sstream>

using namespace std;

enum SpeechSituation {

	SpeechSituation_NULL=0,
	SpeechSituation_WaitingForSelect, // sadece select ve undo calısacak
	SpeechSituation_WaitingForMove // sadece move ve cancel calısacak

};

enum ChessCommandType
{
	ChessCommandType_Select=0,
	ChessCommandType_Move,
	ChessCommandType_Cancel,
	ChessCommandType_Undo,
	ChessCommandType_NULL
};

enum ChessCommandLetterType
{
	ChessCommandLetterType_A=0,
	ChessCommandLetterType_B,
	ChessCommandLetterType_C,
	ChessCommandLetterType_D,
	ChessCommandLetterType_E,
	ChessCommandLetterType_F,
	ChessCommandLetterType_G,
	ChessCommandLetterType_H,
	ChessCommandLetterType_NULL
};

enum ChessCommandDigitType
{
	ChessCommandDigitType_1=0,
	ChessCommandDigitType_2,
	ChessCommandDigitType_3,
	ChessCommandDigitType_4,
	ChessCommandDigitType_5,
	ChessCommandDigitType_6,
	ChessCommandDigitType_7,
	ChessCommandDigitType_8,
	ChessCommandDigitType_NULL
};



struct ChessCommand
{
public:
	ChessCommandType ccType;
	ChessCommandLetterType cclType;
	ChessCommandDigitType ccdType;
	bool isCommandOK;
};


class SpeechFile {
public:

	ifstream spFile;
	long size;
	static SpeechSituation speechSituation;

	ChessCommand GetCommand();
	ChessCommandType GetCommandType(string word);
	ChessCommandLetterType GetCommandLetterType(string word);
	ChessCommandDigitType GetCommandDigitType(string word);
	long GetSize();
	bool OpenFile();
	bool CloseFile();
	SpeechFile();
	virtual ~SpeechFile();
};

#endif /* SPEECHFILE_H_ */
